#include <QApplication>
#include <QTimer>
#include <controller.h>
#include <QString>


#include <QSqlDatabase>
#include <QDebug>
#include <QSqlError>
#include <QSqlQuery>
#include <QSqlRecord>

#include "model.h"

int main(int argc, char** argv) {
    QApplication app(argc, argv);

    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
    db.setDatabaseName("dbname");
    if (!db.open()) {
        qDebug() << "can not open database";
        exit(EXIT_FAILURE);
    }

    Controller c(new Model(0, db));
    //c.setFixedSize(600, 200);
    c.show();
    QTimer::singleShot(0, &c, SLOT(exec()));

    return app.exec();
}
